package  
{
	import org.flixel.FlxSprite;
	import org.flixel.FlxText;
	/**
	 * ...
	 * @author Euan MacDougall
	 */
	public class Collectable extends FlxSprite
	{
		var mWeight:Number, mValue:Number;
		var mName:String, mGraphic:Class;
		var mWidth:Number, mHeight:Number, mFrame:Number;
		
		var mText:FlxText;
		
		public function Collectable(X:Number = 0, Y:Number = 0) 
		{
			super(X, Y);
		}
		
		public function init(Graphic:Class, ImageIndex:int, Weight:Number, Value:Number, Name:String, Width:Number = 16, Height:Number = 16)
		{
			mWeight = Weight;
			mValue = Value;
			mName = Name;
			mGraphic = Graphic;
			mWidth = Width;
			mHeight = Height;
			
			loadGraphic(mGraphic, false, false, Width, Height);
			frame = ImageIndex;
			mFrame = ImageIndex;
			
			mText = new FlxText(0, y, x > 0 ? x * 2 + Width : 1);
			mText.text = "- " + mName + " -\nValue: " + mValue + "\nWeight: " + mWeight;
			mText.alignment = "center";
			mText.y -= mText.height + 34;
			mText.kill();
			
			y -= Height;
		}
	}

}